package grape.sequence.rest.client.generator;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Created by yangwei
 * Created at 2020/8/21
 */
@Component
@FeignClient(value = "grape-sequence")
public interface SequenceGeneratorClient {


    /**
     * 根据配置编码获取下一个序列
     * @param code
     * @return
     */
    @GetMapping(value = "/sequence/generator/inner/code/{code}/next")
    public String nextByCode(@PathVariable String code);

    /**
     * 根据配置id获取下一个序列
     * @param id
     * @return
     */
    @GetMapping(value = "/sequence/generator/inner/id/{id}/next")
    public String nextById(@PathVariable String id);

}
